import { request1,request9 } from './request'

export function getHongBaos(user_id, limit = 20, offset = 0) {
  return request9({
    url: `/users/${user_id}/hongbaos`,
    params: {
      limit,
      offset
    }
  })
}

export function getExpiredHongbaos(user_id, limit = 20, offset = 0) {
  return request9({
    url: `/users/${user_id}/expired_hongbaos`,
    params: {
      limit,
      offset
    }
  })
}

export function getExchange(user_id,data) {
  return request1({
    url: `/users/${user_id}/hongbao/exchange`,
    withCredentials: true,
    method: 'post',
    data
  })
}